<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=0, width=device-width"/>
	<title>api</title>
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../css/common.css" />
	
	<style type="text/css">
	#title{
		padding: 25px 15px;
		color: #666;
	}
.g-Record-ctlst{
	background: #fff;
}
.g-Record-ct {

    padding: 10px 10px 0;
    border-top: 1px solid #D0D0D0;

    background: #f6f6f6;
}

.g-Record-ct .u-Rcd-r {
    margin-left: 90px;
    margin-right: 10px;
}

.g-Record-ct .u-Rcd-r .z-Rcd-tt {
    line-height: 20px;
    max-height: 38px;
    font-size: 14px;
    overflow: hidden;
    margin-bottom: 5px;
}

.g-Record-ctlst {
    position: relative;
}


.g-Record-ctlst h3 {
    line-height: 30px;
    padding-top: 5px;
    text-indent: 10px;
    color: #666;
}

.g-Record-ctlst h3 em.orange {
    margin: 0 3px;
}

.g-Record-ctlst li {
    line-height: 22px;
    color: #666;
    border-top: 1px dotted #CBCBCB;
    padding: 5px 0 5px 0;
    cursor: pointer;
}

.g-Record-ctlst li p {
    margin: 0 10px;
}
.g-Record-ctlst li{
	width: 100%;
	overflow: hidden;
	word-wrap: break-word;
}
.g-Record-ctlst li #bb{
	padding: 5px;
}

.g-Record-ctlst li b {
	margin-right: 5px;
	overflow: hidden;
	word-wrap: break-word;
    width: 76px;
    text-align: left;
    text-align: center;
}

.g-Record-ctlst li span {
    margin-left: 15px;
}

.g-Record-lst {
    padding: 0;
    box-shadow: 0 1px 1px #E8E8E8 inset;
    background: #f6f6f6;
    overflow: hidden;
    zoom: 1;
}

.g-Record-lst ul {
    margin-top: -1px;
}

.g-Record-lst li {
    min-height: 83px;
    padding: 10px;
    position: relative;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #DDD;
}

.g-Record-lst li.bornone {
    border-bottom: none;
}

.g-Record-lst li .z-arrow {
    border-width: 2px 2px 0 0;
    position: absolute;
    right: 10px;
    top: 54px;
}

.g-Record-lst .u-sgl-r {
    margin-left: 90px;
    margin-right: 10px;
}

.g-Record-lst .u-sgl-r .z-sgl-tt {
    line-height: 20px;
    max-height: 38px;
    font-size: 14px;
    overflow: hidden;
    margin-bottom: 5px;
}

.g-Record-lst .u-sgl-r p {
    margin-bottom: 3px;
}

.g-Record-lst .u-sgl-r p em {
    margin: 0 3px;
}

.g-Record-lst .Pro-bar-li li {
    min-height: 20px;
}

.g-Record-lst .Pro-bar-li li em {
    padding: 0;
}
	</style>
</head>

<body >
<script id="buyCode-template" type="text/x-dot-template">
<div id="title">(第{{=it[0].shopqishu}}期){{=it[0].title}}</div>
<section class="clearfix g-member g-Record-ctlst">
	    <b class="z-arrow"></b>
	   
	    	<article class="m-round" >
		    <h3>本期商品总共拥有<em class="orange">{{=it[0].total}}</em>个猫购码</h3>
		    <ul>
		    {{ for(var i=0; i< it.length; i++) { }}
		    	<li><p class="gray9">{{=it[i].mictime}}<span>{{=it[i].gonumber}}人次</span></p><div id='bb'>{{=it[i].goucode}}</div></li>
						    
			{{}}}
<!-- {{ for(var i=0; i< it.length; i++) { }}
11111 -->
<!-- <li><p class="gray9">2016-05-09 20:54:56.575<span>5人次</span></p><div id='bb'><b>10001755</b></div></li> -->
<!-- {{}}} -->
			    </ul>
	    </article>
	    
	    
    </section>
</script>
 <div id='buyCode-content'>

    </div>


</body>
	<script type="text/javascript" src="../script/zepto.min.js"></script>

	<script type="text/javascript" src="../script/api.js"></script>
	
	<script src='../script/swipe.js'></script>
	<script type="text/javascript" src="../script/doT.min.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	<script type="text/javascript">
		apiready = function(){
		    var id = api.pageParam.shopId;
		    var uid = api.pageParam.uid;
		   
		    getBuyCode(id,uid);
		}
		//获取用户购买的猫购码
		function getBuyCode(id,uid){
			   	api.ajax({
				        url: 'http://wap.jqmao.cn/getBuyCode',
				        method: 'post',
				        data: {
				            values: {id: id, uid: uid}
				        }
				    }, function (ret, err) {

				        if (ret) {
				        	
			
				            var content = $api.byId('buyCode-content');
				            var tpl = $api.byId('buyCode-template').text;
				            var tempFn = doT.template(tpl);
				            $api.append(content, tempFn(ret['listItems']));
				       

				        } else {
				           //alert(JSON.stringify(err));
				        }
        
   				});
		}
		    
	</script>
		
	

</html>